Page({
    properties: {},
    data: {
      // 判断按钮是否显示
    up_show: false,
        tabs:['全部服务','热门服务','新人专享'],
        //当前选中的标签项目
        currentTabIndex:0,
  //优惠列表
   //分类列表1
   tjcategoryList:[
    {
        "id":1,
        "name":"新居开荒",
        "src":"/images/upload/kaihuang.jpg"
    }, {
        "id":2,
        "name":"家电清洗",
        "src":"/images/upload/richang.jpg"
    }, {
        "id":3,
        "name":"沙发清洗",
        "src":"/images/upload/shafa.jpg"
    }, {
        "id":4,
        "name":"清检螨虫",
        "src":"/images/upload/jiaquan.jpg"
    }, {
        "id":5,
        "name":"夜间保洁",
        "src":"/images/upload/yejian.jpg"
    }, {
        "id":6,
        "name":"窗户清洗",
        "src":"/images/upload/chuanghu.jpg"
    },

],
        //分类列表1
        categoryList:[
            {
                "id":1,
                "name":"家政保洁",
                "src":"/images/upload/jiazehng.jpg"
            }, {
                "id":2,
                "name":"家电清洗",
                "src":"/images/upload/xiyiji.jpg"
            }, {
                "id":3,
                "name":"保姆月嫂",
                "src":"/images/upload/baomu.jpg"
            }, {
                "id":4,
                "name":"清检螨虫",
                "src":"/images/upload/jiace.jpg"
            }, {
                "id":5,
                "name":"管道疏通",
                "src":"/images/upload/水管.jpg"
            }, {
                "id":6,
                "name":"深度保洁",
                "src":"/images/upload/shuichi.jpg"
            },{
              "id":7,
              "name":"家具养护",
              "src":"/images/upload/xicehnqi.jpg"
          },

        ],
         //热门服务2分类列表2
         categoryList2:[
          {
            "id":3,
            "name":"保姆月嫂",
            "src":"/images/upload/baomu.jpg"
        },
          {
            "id":6,
            "name":"深度保洁",
            "src":"/images/upload/shuichi.jpg"
        },
          {
              "id":1,
              "name":"家政保洁",
              "src":"/images/upload/jiazehng.jpg"
          }, {
              "id":2,
              "name":"家电清洗",
              "src":"/images/upload/xiyiji.jpg"
          },  {
              "id":4,
              "name":"清检螨虫",
              "src":"/images/upload/jiace.jpg"
          }, 

      ],
       //新人专享
       categoryList3:[
        {
          "id":6,
          "name":"深度保洁",
          "src":"/images/upload/shuichi.jpg"
      },
      {
        "id":4,
        "name":"清检螨虫",
        "src":"/images/upload/jiace.jpg"
    }, 
        {
          "id":3,
          "name":"保姆月嫂",
          "src":"/images/upload/baomu.jpg"
      },
       
        {
            "id":1,
            "name":"家政保洁",
            "src":"/images/upload/jiazehng.jpg"
        }, {
            "id":2,
            "name":"家电清洗",
            "src":"/images/upload/xiyiji.jpg"
        },  

    ],
    //今日优惠
    categoryList4:[
      {
        "id":6,
        "name1":"开荒保洁",
        "src1":"/images/upload/kaihuang.jpg",
        "price1":"￥15.00",
        "sale1":"￥12起"
        
    },
   
  ],categoryList5:[
  
  {
    "id":4,
    "name2":"油烟机清洗",
    "src2":"/images/upload/youyanji.jpg",
    "price2":"￥258.00",
    "sale2":"￥188起"
}, 
],
categoryList6:[
   {
"id":4,
"name3":"洗衣机清洗",
"src3":"/images/upload/richang.jpg",
"price3":"￥198.00",
"sale3":"￥175起"
}

],
// 热门服务底层数据  基本绑定四个  已售的之后每次加随机数或者每天改一下
hotList:[
  {
    "id":1,
    "name":"日常保洁",
    "content":"日常的保洁卫生打扰，不含擦洗玻璃",
    "src":"/images/upload/richang.jpg",
    
    "sale":"￥95起"
    }, {
      "id":2,
      "name":"擦洗玻璃",
      "content":"18元/一平米，不足10平米按10平米计算",
      "src":"/images/upload/chuanghu.jpg",    
      "sale":"￥180起"
      }, {
        "id":2,
        "name":"沙发清洗",
        "content":"沙发清洗 除霉菌斑点 专业师傅 专业工具",
        "src":"/images/upload/shafa.jpg",
        "sale":"￥320起"
        }, {
          "id":2,
          "name":"夜间日常保洁",
          "content":"17点到21点之间任选三小时 量身定制",
          "src":"/images/upload/yejian.jpg",
          
          "sale":"￥195起"
          }, {
            "id":2,
            "name":"开荒保洁",
            "content":"",
            "src":"/images/upload/kaihuang.jpg",
            "sale":"￥180起"
            }
      
    
  ],
        current: 2,  //当前所在页面的 index
    
        indicatorDots: true, //是否显示面板指示点
    
        autoplay: true, //是否自动切换
    
        interval: 3600, //自动切换时间间隔
    
        duration: 1000, //滑动动画时长
    
        circular: true, //是否采用衔接滑动
    
        imgUrls: [
    
          '/images/upload/18-09-53.jpg',
    
          '/images/upload/18-13-10.jpg',
    
          '/images/upload/18-24-36.jpg'
    
        ],
    
        links: [
    
          '/pages/publish/publish',
    
          '/pages/publish/publish',
    
          '/pages/publish/publish'
    
        ],
        src: '/images/upload/tishi.png'
    
      },
    
      //轮播图的切换事件
    
      swiperChange: function(e) {
    
        this.setData({
    
          swiperCurrent: e.detail.current
    
        })
    
      },
    
      //点击指示点切换
    
      chuangEvent: function(e) {
    
        this.setData({
    
          swiperCurrent: e.currentTarget.id
    
        })
    
      },
    
      //点击图片触发事件
    
      swipclick: function(e) {
    
        console.log(this.data.swiperCurrent);
    
        wx.switchTab({
    
          url: this.data.links[this.data.swiperCurrent]
    
        })
    
      },
      //提示弹出层
      uploadTishi:function(e){
        // 提示框
        wx.showModal({
          title: '提示',
          showCancel:false,
          content: '下单联系服务后，会有专门小姐姐与您核对哦，请耐心等待哟',
          success: function (res) {
            if (res.confirm) {
              console.log('确定')
            } else {
              console.log('取消')
            }
          }
        })
      },
   

      //接受传递过来的参数 自定义事件
      zdhandleTabChange:function(event){
        console.log(event.detail.index);
     this.setData({
       testCurrent:event.detail.index
     })
      },
    //点击滑块内容事件
    handleCategoryChange:function (event){
    
      const id=event.currentTarget.dataset.id
    },
    //回到顶部
  goTop: function(e) { // 一键回到顶部
    if (wx.pageScrollTo) {
      wx.pageScrollTo({
        scrollTop: 0
      })
    } else {
      wx.showModal({
        title: '提示',
        content: '当前微信版本过低，无法使用该功能，请升级到最新微信版本后重试。'
      })
    }
  },
  // 监听页面滑动
  onPageScroll: function(e) {
    // console.log("滚动" + e.scrollTop)
    var that = this;
	// 当滚动条位置 > 30 按钮显示
    // 当滚动条位置 < 30 按钮隐藏
    if (e.scrollTop > 30) {
      that.setData({
        up_show: true
      })
    }
    if (e.scrollTop < 30) {
      that.setData({
        up_show: false
      })
    }
  },

  uploadgzh: function () {
    wx.showToast({
      title: '扫一扫公众号',
      image: '/images/upload/richang.jpg',  //image的优先级会高于icon
      duration: 2000     
    })
  },
  
});
